package main

import (
	"fmt"
)

type Book struct {
	title  string
	author string
	price  float64
}

func main() {
	var book1 Book = Book{"go语言实战", "William Kennedy", 86.9}
	var book2 Book
	book2.title = "Python编程实战"
	book2.author = "Mark Summerfield"
	book2.price = 69.00
	fmt.Println(book1)
	fmt.Println(book2)
	fmt.Printf("%s\t\t%s\t\t%.2f\n", book1.title, book1.author, book1.price)
	fmt.Printf("%s\t\t%s\t%.2f\n", book2.title, book2.author, book2.price)

	book1.price = 85.90
	fmt.Printf("%s\t\t%s\t\t%.2f\n", book1.title, book1.author, book1.price)
	changeStruct(&book1)
	fmt.Printf("%s\t\t%s\t\t%.2f\n", book1.title, book1.author, book1.price)

}

func changeStruct(book *Book) {
	book.price = 15.2
}
